import axios from './axios'
import qs from 'qs'
import {appUrl} from '@/config/config'
// 修改密码 /agent-center/user/changePwd
export const changePwd = (data) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/user/changePwd',
            method: 'post',
            data:qs.stringify(data)
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 新用户修改密码
export const userUpdatePwd = (data) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/user/userUpdatePwd',
            method: 'post',
            data:qs.stringify(data)
        }).then(res => {
            resolve(res.data)
        })
    })
}

// 退出登录 /agent-center/user/userLogout
export const userLogout = (params) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/user/userLogout',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 机构信息  /agent-center/agent/agentDetailByMoblie
export const agentDetail = (params) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/agent/agentDetailByMoblie',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 体现记录 ST/agent-center/agent/listAgentSettle
export const cashRecord = (params) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/agent/pageWithdrawalRecord',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 体现 /agent-center/agent/withdrawalOperation
export const getCash = (params) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/agent/withdrawalOperation',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 代理商余额 /agent-center/agent/getAgentDetailById
export const getAgentDetail = (params) => {
	// console.log(params)
    return new Promise((resolve,reject) => {
        axios({
            url: appUrl + '/agent-center/agent/getAgentDetailById',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}